import auth from '../../utils/auth.js';  // 路径根据你的项目结构调整
import {request} from '../../utils/request.js';  // 路径根据你的项目结构调整


Page({
    onShareAppMessage() {
        return {
            title: 'swiper',
            path: 'page/component/pages/swiper/swiper'
        }
    },

    onLoad() {
        const app = getApp();
        app.loginPromise.then(token => {
            console.log(token)
            this.getCodeList()
        });


    },

    // 模拟或请求挪车码列表数据
    getCodeList() {
        request({
            url: '/api/user/info'
        }).then(res => {
            console.log(res)
        })
    },

    data: {
        background: ['/assets/bg1.jpg', '/assets/bg2.jpg','/assets/bg3.jpg',],
        indicatorDots: true,
        vertical: false,
        autoplay: false,
        interval: 2000,
        duration: 500
    },

    changeIndicatorDots() {
        this.setData({
            indicatorDots: !this.data.indicatorDots
        })
    },

    changeAutoplay() {
        this.setData({
            autoplay: !this.data.autoplay
        })
    },

    intervalChange(e) {
        this.setData({
            interval: e.detail.value
        })
    },

    durationChange(e) {
        this.setData({
            duration: e.detail.value
        })
    }
})